<template>
  <view>
    <!-- 原有页面内容 -->
    <button @click="showAddModal">新增套餐</button>
    
    <!-- 弹窗组件 -->
    <PackageModal 
      v-if="isModalVisible" 
      @close="isModalVisible = false"
      @submit="handleAddPackage"
    />
  </view>
</template>

<script>
import PackageModal from './PackageModal.vue';

export default {
  components: { PackageModal },
  data() {
    return {
      isModalVisible: false,
      packageList: []
    };
  },
  methods: {
    showAddModal() {
      this.isModalVisible = true;
    },
    handleAddPackage(newPackage) {
      // 添加到套餐列表
      this.packageList.push(newPackage);
      // 显示成功提示
      uni.showToast({ title: '套餐添加成功' });
    }
  }
}
</script>